package com.airbat.prize.modules.system.controller.user.vo.profile;

import com.airbat.prize.modules.system.controller.user.vo.user.SysUserBaseVO;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;


@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("用户个人中心信息 Response VO")
public class SysUserProfileRespVO extends SysUserBaseVO {

    @ApiModelProperty(value = "用户编号", required = true, example = "1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
    private Integer status;

    @ApiModelProperty(value = "最后登陆 IP", required = true, example = "192.168.1.1")
    private String loginIp;

    @ApiModelProperty(value = "最后登录时间", required = true, example = "时间戳格式")
    private Date loginDate;

    @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
    private Date createTime;

    @ApiModelProperty(value = "操作权限，1部门管理员")
    private Integer optRole;

    /**
     * 所属角色
     */
    private List<Role> roles;

    /**
     * 所在架构
     */
    private Struc struc;

    /**
     * 所在部门
     */
    private Dept dept;

    /**
     * 所属岗位数组
     */
    private Post post;

    @ApiModel("角色")
    @Data
    public static class Role {

        @ApiModelProperty(value = "角色编号", required = true, example = "1")
        @JsonSerialize(using = ToStringSerializer.class)
        private Long id;

        @ApiModelProperty(value = "角色名称", required = true, example = "普通角色")
        private String name;

    }

    @ApiModel("架构")
    @Data
    public static class Struc {

        @ApiModelProperty(value = "架构编号", required = true, example = "1")
        private String id;

        @ApiModelProperty(value = "架构名称", required = true, example = "研发部")
        private String name;

    }

    @ApiModel("部门")
    @Data
    public static class Dept {

        @ApiModelProperty(value = "部门编号", required = true, example = "1")
        @JsonSerialize(using = ToStringSerializer.class)
        private Long id;

        @ApiModelProperty(value = "部门名称", required = true, example = "研发部")
        private String name;

        @ApiModelProperty(value = "部门类型 0其他 1辖区派出所 2打黑办")
        private Integer deptType;

        @ApiModelProperty(value = "地区类型 1区县 2市 3省")
        private Integer areaType;

    }

    @ApiModel("警种")
    @Data
    public static class Post {

        @ApiModelProperty(value = "警种编号", required = true, example = "1")
        private Long id;

        @ApiModelProperty(value = "警种名称", required = true, example = "开发")
        private String name;

    }

}
